package com.nian.user.center.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nian.common.model.ServerResponse;
import com.nian.user.model.AppUser;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zhangmj
 * @since 2020-04-05
 */
public interface IAppUserService extends IService<AppUser> {
    /**
     * 根据用户名获取会员
     */
    AppUser getByUsername(String loginName);

    /**
     * 根据用户电话获取会员
     */
    AppUser getByPhoneNum(String phoneNum);

    ServerResponse register(String loginName, String password, String phoneNum, String authCode);

    ServerResponse login(String username, String password);
    /**
     * 生成验证码
     */
    ServerResponse generateAuthCode(String phoneNum);

    String refreshToken(String token);

    void logout(AppUser base);
}
